package com.zhanglijie.base.other.joinDemo;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/6/26 0026 20:16
 */
public class JoinDemo1 {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("main start");
        Thread t1 = new Thread(()->{
            System.out.println(Thread.currentThread().getName()+" running ");
        },"t1");

        Thread t2 = new Thread(()->{
            System.out.println(Thread.currentThread().getName()+" running ");
        },"t2");

        t1.start();
        t2.start();
        t1.join( );
        t2.join(20000);
       
        System.out.println("main end");
    }
}
